package com.dice.dagger2study.present;

import com.dice.dagger2study.model.Imp.LoginModelImp;
import com.dice.dagger2study.model.i.ILoginModel;
import com.dice.dagger2study.view.ILoginView;

/**
 * Created by weiyi on 2017/11/14.
 */

public class UserPresent<T> extends BasePersenter<ILoginView> {

    private ILoginModel mLoginModel = new LoginModelImp();
    /**
     * 持有视图层 UI接口的引用  此时的视图层Activity
     */
    private ILoginView mILoginView;

    public UserPresent(ILoginView view) {
        this.mILoginView = view;
    }


    public void login(){
        String code = mILoginView.getPassword();
        String phone = mILoginView.getUserName();

        mILoginView.showLoading();
        mLoginModel.login(mILoginView.getUserName(), mILoginView.getPassword(),new ILoginModel.LoginListener(){

            @Override
            public void success() {

            }

            @Override
            public void falied(int code, String msg) {

            }
        });
    }

    @Override
    public void fetch() {

    }
}
